package com.bac.rentmap.ad.flat.rating.item;

import java.util.Calendar;
import java.util.Date;

public class DateRatingHelper {
	/**
	 * (date1 - (date1 - 1day)) / DEVIDER = 100. So the rating of the same ads
	 * posted with one day difference differs on 100.
	 */
	public static final long DEVIDER = 24 * 3600 * 10;

	public static long getDateRating(Date date) {
		return date.getTime() / DEVIDER;
	}

	public static long getMaxDateRating() {
		return new Date().getTime() / DEVIDER;
	}

	public static long getMinDateRating() {
		Calendar calendar = Calendar.getInstance();
		calendar.add(Calendar.DATE, -7);
		return getDateRating(calendar.getTime());
	}

}
